package com.example.demo.core.base;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 基类
 */

@Data
public abstract class BizEntity<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /**
     * 商户id
     */
    @TableField
    private Long merchantId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;

    /**
     * 逻辑删除状态 0-未删除  1-已删除
     */
    @TableField
    @TableLogic
    private Integer deleted;

    protected abstract Serializable pkVal();
}
